'use strict';

module.exports = app => {
    const { STRING, INTEGER, DATE, ENUM } = app.Sequelize;
    // 配置（重要：一定要配置详细，一定要！！！）
    const AdminNav = app.model.define('admin_nav', {
        id: {
            type: INTEGER(30).UNSIGNED,
            primaryKey: true,
            autoIncrement: true
        },
        text: {
            type: STRING(100),
            allowNull: false,
            defaultValue: '',
            comment: '名称',
        },
        path: {
            type: STRING(100),
            allowNull: false,
            defaultValue: '',
            comment: '路径',
        },
        name: {
            type: STRING(100),
            allowNull: false,
            defaultValue: '',
            comment: '标题',
        },
        component: {
            type: STRING(200),
            allowNull: false,
            defaultValue: '',
            comment: '关键词',
        },
        created_at: DATE,
        updated_at: DATE,
    });
    return AdminNav;
};